package com.gitee.ly.ymorm.plugin;

import java.util.Properties;

/**
 * Interceptor
 *
 * @author ly
 **/
public interface Interceptor {
    Object intercept(Invocation invocation) throws Throwable;

    /**
     * 生成拦截代理对象,代理对应方法
     *
     * @param target
     * @return
     */
    default Object plugin(Object target) {
        return Plugin.wrap(target, this);
    }

    default void setProperties(Properties properties) {
        // NOP
    }
}
